/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __PQ_ProjectResourceManager_H__
#define __PQ_ProjectResourceManager_H__

#include "EnginePrerequisites.h"

namespace PQEngine
{
	class ProjectDefaultResource
	{
	public:
		static const std::string BRUSH_PATH;
		static const std::string BRUSH_GROUP;
	};
	
	enum ProjectResourceType
	{
		RES_TYPE_UNKNOWN,
		RES_TYPE_MESH,
		RES_TYPE_SCRIPT_CSHARP,
		RES_TYPE_ZIP,
		RES_TYPE_FILE_BLEND,
	};

	class ProjectResourceGroupType
	{
	public:
		static const std::string FILE_SYSTEM;//from file
		static const std::string ZIP;
	};

	class ProjectResourceGroup
	{
	private:
		int _count;
		std::vector<std::string> _folderPathes;//resources pathes
		std::vector<std::string> _resourceGroupNames;
	protected:
		ProjectResourceGroup();
	public:
		inline std::vector<std::string>& getResourceGroupPathes()
		{
			return _folderPathes;
		}

		void getResourceList();
		static ProjectResourceGroup& getSingleton();
		bool isLegalResource(std::string path);
		//get resource group name by path
		std::string getResourceGroupName(std::string path);
		//x scene view mouse x
		bool addResource(std::string filePath);
		bool hasResourceLoc(std::string path);
	};


	class ProjectResourceManager
	{
	protected:
		ProjectResourceManager();
	public:
		static ProjectResourceType getResourceExtType(std::string type);
		static ProjectResourceManager& getSingleton();
		void loadDefaultResource();
	};
}

#define GNgResourceGroup PQEngine::ProjectResourceGroup::getSingleton()
#endif
